<?php

namespace app\mall\ui\table;

use app\mall\enum\ScoreEnum;
use suframe\thinkAdmin\ui\table\TableInterface;

/**
 * 商品评论表格
 */
class MallGoodsCommentTable extends TableInterface
{
    public function header()
    {
        return [
            'id' => ['label' => 'ID', 'sort' => true, 'fixed' => 'left', 'width' => 70],
            'uid'=> ['label' => '用户UID', 'width' => 80],
            'user_nickname'=> ['label' => '用户', 'width' => 120],
            'goods_title'=> ['label' => '商品'],
            'store_name'=> ['label' => '门店'],
            'create_time'=> ['label' => '创建时间', 'width' => 160],
            'score'=> ['label' => '分数', 'filter' => ScoreEnum::toZhArray(), 'width' => 80],
            'comment'=> ['label' => '评论内容'],
            'images'=> ['label' => '评论晒图', 'type' => 'images'],
        ];
    }

    public function filters()
    {
        return [
            'uid' => ['label' => '用户UID', 'type' => 'text'],
            'store_id' => ['label' => '门店ID', 'type' => 'int'],
            'goods_id' => ['label' => '商品ID', 'type' => 'int'],
            'comment' => ['label' => '内容模糊搜索', 'type' => 'text'],
            'create_time' => ['label' => '评论时间', 'type' => 'daterange'],
        ];
    }
}